<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libfuse: example/null.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libfuse
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_cfafba98a580ce4b62f8a6fa96d7cbb0.html">example</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">null.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;<a class="el" href="fuse_8h_source.html">fuse.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="fuse__lowlevel_8h_source.html">fuse_lowlevel.h</a>&gt;</code><br />
<code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;unistd.h&gt;</code><br />
<code>#include &lt;time.h&gt;</code><br />
<code>#include &lt;errno.h&gt;</code><br />
</div>
<p><a href="null_8c_source.html">Go to the source code of this file.</a></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This "filesystem" provides only a single file. The mountpoint needs to be a file rather than a directory. All writes to the file will be discarded, and reading the file always returns \0.</p>
<p>Compile with: </p><pre class="fragment">gcc -Wall null.c `pkg-config fuse3 --cflags --libs` -o null
</pre><h2>Source code</h2>
<div class="fragment"><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment">  FUSE: Filesystem in Userspace</span></div><div class="line"><span class="comment">  Copyright (C) 2001-2007  Miklos Szeredi &lt;miklos@szeredi.hu&gt;</span></div><div class="line"><span class="comment">  Copyright (C) 2011       Sebastian Pipping &lt;sebastian@pipping.org&gt;</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">  This program can be distributed under the terms of the GNU GPL.</span></div><div class="line"><span class="comment">  See the file COPYING.</span></div><div class="line"><span class="comment">*/</span></div><div class="line"></div><div class="line"><span class="preprocessor">#define FUSE_USE_VERSION 31</span></div><div class="line"></div><div class="line"><span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div><div class="line"><span class="preprocessor">#include &lt;config.h&gt;</span></div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"><span class="preprocessor">#define _GNU_SOURCE</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="fuse_8h.html">fuse.h</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#ifdef HAVE_LIBULOCKMGR</span></div><div class="line"><span class="preprocessor">#include &lt;ulockmgr.h&gt;</span></div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;unistd.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;fcntl.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;sys/stat.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;dirent.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;errno.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;sys/time.h&gt;</span></div><div class="line"><span class="preprocessor">#ifdef HAVE_SETXATTR</span></div><div class="line"><span class="preprocessor">#include &lt;sys/xattr.h&gt;</span></div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"><span class="preprocessor">#include &lt;sys/file.h&gt;</span> <span class="comment">/* flock(2) */</span></div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> *xmp_init(<span class="keyword">struct</span> <a class="code" href="structfuse__conn__info.html">fuse_conn_info</a> *conn,</div><div class="line">                      <span class="keyword">struct</span> <a class="code" href="structfuse__config.html">fuse_config</a> *cfg)</div><div class="line">{</div><div class="line">        (void) conn;</div><div class="line">        cfg-&gt;<a class="code" href="structfuse__config.html#adf78e64e79e31c4fe1464cd0744ea725">use_ino</a> = 1;</div><div class="line">        cfg-&gt;<a class="code" href="structfuse__config.html#adc93fd1ac03d7f016d6b0bfab77f3863">nullpath_ok</a> = 1;</div><div class="line"></div><div class="line">        <span class="comment">/* Pick up changes from lower filesystem right away. This is</span></div><div class="line"><span class="comment">           also necessary for better hardlink support. When the kernel</span></div><div class="line"><span class="comment">           calls the unlink() handler, it does not know the inode of</span></div><div class="line"><span class="comment">           the to-be-removed entry and can therefore not invalidate</span></div><div class="line"><span class="comment">           the cache of the associated inode - resulting in an</span></div><div class="line"><span class="comment">           incorrect st_nlink value being reported for any remaining</span></div><div class="line"><span class="comment">           hardlinks to this inode. */</span></div><div class="line">        cfg-&gt;<a class="code" href="structfuse__config.html#a9bc2e3b1d8a4410215cd620553e61b62">entry_timeout</a> = 0;</div><div class="line">        cfg-&gt;<a class="code" href="structfuse__config.html#aeba85551d9498ca85fa2bf13b5e78eda">attr_timeout</a> = 0;</div><div class="line">        cfg-&gt;<a class="code" href="structfuse__config.html#ab4205f7343afe6e20edfbfb64cb90248">negative_timeout</a> = 0;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> NULL;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_getattr(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> stat *stbuf,</div><div class="line">                        <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        (void) path;</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span>(fi)</div><div class="line">                res = fstat(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, stbuf);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">                res = lstat(path, stbuf);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_access(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keywordtype">int</span> mask)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        res = access(path, mask);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_readlink(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> size)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        res = readlink(path, buf, size - 1);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        buf[res] = <span class="charliteral">&#39;\0&#39;</span>;</div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">struct </span>xmp_dirp {</div><div class="line">        DIR *dp;</div><div class="line">        <span class="keyword">struct </span>dirent *entry;</div><div class="line">        off_t offset;</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_opendir(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line">        <span class="keyword">struct </span>xmp_dirp *d = malloc(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> xmp_dirp));</div><div class="line">        <span class="keywordflow">if</span> (d == NULL)</div><div class="line">                <span class="keywordflow">return</span> -ENOMEM;</div><div class="line"></div><div class="line">        d-&gt;dp = opendir(path);</div><div class="line">        <span class="keywordflow">if</span> (d-&gt;dp == NULL) {</div><div class="line">                res = -errno;</div><div class="line">                free(d);</div><div class="line">                <span class="keywordflow">return</span> res;</div><div class="line">        }</div><div class="line">        d-&gt;offset = 0;</div><div class="line">        d-&gt;entry = NULL;</div><div class="line"></div><div class="line">        fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a> = (<span class="keywordtype">unsigned</span> long) d;</div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keyword">struct </span>xmp_dirp *get_dirp(<span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordflow">return</span> (<span class="keyword">struct</span> xmp_dirp *) (uintptr_t) fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_readdir(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keywordtype">void</span> *buf, <a class="code" href="fuse_8h.html#a7dd132de66a5cc2add2a4eff5d435660">fuse_fill_dir_t</a> filler,</div><div class="line">                       off_t offset, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi,</div><div class="line">                       <span class="keyword">enum</span> <a class="code" href="fuse_8h.html#af2bcf2a473b41b3cc8da8c079656a074">fuse_readdir_flags</a> flags)</div><div class="line">{</div><div class="line">        <span class="keyword">struct </span>xmp_dirp *d = get_dirp(fi);</div><div class="line"></div><div class="line">        (void) path;</div><div class="line">        <span class="keywordflow">if</span> (offset != d-&gt;offset) {</div><div class="line"><span class="preprocessor">#ifndef __FreeBSD__</span></div><div class="line">                seekdir(d-&gt;dp, offset);</div><div class="line"><span class="preprocessor">#else</span></div><div class="line">                <span class="comment">/* Subtract the one that we add when calling</span></div><div class="line"><span class="comment">                   telldir() below */</span></div><div class="line">                seekdir(d-&gt;dp, offset-1);</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line">                d-&gt;entry = NULL;</div><div class="line">                d-&gt;offset = offset;</div><div class="line">        }</div><div class="line">        <span class="keywordflow">while</span> (1) {</div><div class="line">                <span class="keyword">struct </span>stat st;</div><div class="line">                off_t nextoff;</div><div class="line">                <span class="keyword">enum</span> <a class="code" href="fuse_8h.html#af1d0194d186240ef6aaf6e9bf8568568">fuse_fill_dir_flags</a> fill_flags = 0;</div><div class="line"></div><div class="line">                <span class="keywordflow">if</span> (!d-&gt;entry) {</div><div class="line">                        d-&gt;entry = readdir(d-&gt;dp);</div><div class="line">                        <span class="keywordflow">if</span> (!d-&gt;entry)</div><div class="line">                                <span class="keywordflow">break</span>;</div><div class="line">                }</div><div class="line"><span class="preprocessor">#ifdef HAVE_FSTATAT</span></div><div class="line">                <span class="keywordflow">if</span> (flags &amp; <a class="code" href="fuse_8h.html#af2bcf2a473b41b3cc8da8c079656a074ad62ab7c23f966a76282921e9187ca441">FUSE_READDIR_PLUS</a>) {</div><div class="line">                        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">                        res = fstatat(dirfd(d-&gt;dp), d-&gt;entry-&gt;d_name, &amp;st,</div><div class="line">                                      AT_SYMLINK_NOFOLLOW);</div><div class="line">                        <span class="keywordflow">if</span> (res != -1)</div><div class="line">                                fill_flags |= <a class="code" href="fuse_8h.html#af1d0194d186240ef6aaf6e9bf8568568a3f50d11935fe96eb4df6ff0844c4e153">FUSE_FILL_DIR_PLUS</a>;</div><div class="line">                }</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line">                <span class="keywordflow">if</span> (!(fill_flags &amp; <a class="code" href="fuse_8h.html#af1d0194d186240ef6aaf6e9bf8568568a3f50d11935fe96eb4df6ff0844c4e153">FUSE_FILL_DIR_PLUS</a>)) {</div><div class="line">                        memset(&amp;st, 0, <span class="keyword">sizeof</span>(st));</div><div class="line">                        st.st_ino = d-&gt;entry-&gt;d_ino;</div><div class="line">                        st.st_mode = d-&gt;entry-&gt;d_type &lt;&lt; 12;</div><div class="line">                }</div><div class="line">                nextoff = telldir(d-&gt;dp);</div><div class="line"><span class="preprocessor">#ifdef __FreeBSD__              </span></div><div class="line">                <span class="comment">/* Under FreeBSD, telldir() may return 0 the first time</span></div><div class="line"><span class="comment">                   it is called. But for libfuse, an offset of zero</span></div><div class="line"><span class="comment">                   means that offsets are not supported, so we shift</span></div><div class="line"><span class="comment">                   everything by one. */</span></div><div class="line">                nextoff++;</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line">                <span class="keywordflow">if</span> (filler(buf, d-&gt;entry-&gt;d_name, &amp;st, nextoff, fill_flags))</div><div class="line">                        <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line">                d-&gt;entry = NULL;</div><div class="line">                d-&gt;offset = nextoff;</div><div class="line">        }</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_releasedir(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keyword">struct </span>xmp_dirp *d = get_dirp(fi);</div><div class="line">        (void) path;</div><div class="line">        closedir(d-&gt;dp);</div><div class="line">        free(d);</div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_mknod(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, mode_t mode, dev_t rdev)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span> (S_ISFIFO(mode))</div><div class="line">                res = mkfifo(path, mode);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">                res = mknod(path, mode, rdev);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_mkdir(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, mode_t mode)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        res = mkdir(path, mode);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_unlink(<span class="keyword">const</span> <span class="keywordtype">char</span> *path)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        res = unlink(path);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_rmdir(<span class="keyword">const</span> <span class="keywordtype">char</span> *path)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        res = rmdir(path);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_symlink(<span class="keyword">const</span> <span class="keywordtype">char</span> *from, <span class="keyword">const</span> <span class="keywordtype">char</span> *to)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        res = symlink(from, to);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_rename(<span class="keyword">const</span> <span class="keywordtype">char</span> *from, <span class="keyword">const</span> <span class="keywordtype">char</span> *to, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> flags)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        <span class="comment">/* When we have renameat2() in libc, then we can implement flags */</span></div><div class="line">        <span class="keywordflow">if</span> (flags)</div><div class="line">                <span class="keywordflow">return</span> -EINVAL;</div><div class="line"></div><div class="line">        res = rename(from, to);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_link(<span class="keyword">const</span> <span class="keywordtype">char</span> *from, <span class="keyword">const</span> <span class="keywordtype">char</span> *to)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        res = link(from, to);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_chmod(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, mode_t mode,</div><div class="line">                     <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span>(fi)</div><div class="line">                res = fchmod(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, mode);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">                res = chmod(path, mode);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_chown(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, uid_t uid, gid_t gid,</div><div class="line">                     <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span> (fi)</div><div class="line">                res = fchown(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, uid, gid);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">                res = lchown(path, uid, gid);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_truncate(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, off_t size,</div><div class="line">                         <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span>(fi)</div><div class="line">                res = ftruncate(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, size);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">                res = truncate(path, size);</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="preprocessor">#ifdef HAVE_UTIMENSAT</span></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_utimens(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">const</span> <span class="keyword">struct</span> timespec ts[2],</div><div class="line">                       <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        <span class="comment">/* don&#39;t use utime/utimes since they follow symlinks */</span></div><div class="line">        <span class="keywordflow">if</span> (fi)</div><div class="line">                res = futimens(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, ts);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">                res = utimensat(0, path, ts, AT_SYMLINK_NOFOLLOW);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_create(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, mode_t mode, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> fd;</div><div class="line"></div><div class="line">        fd = open(path, fi-&gt;<a class="code" href="structfuse__file__info.html#ae7d31802727be19670193a411647bca5">flags</a>, mode);</div><div class="line">        <span class="keywordflow">if</span> (fd == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a> = fd;</div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_open(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> fd;</div><div class="line"></div><div class="line">        fd = open(path, fi-&gt;<a class="code" href="structfuse__file__info.html#ae7d31802727be19670193a411647bca5">flags</a>);</div><div class="line">        <span class="keywordflow">if</span> (fd == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a> = fd;</div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_read(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> size, off_t offset,</div><div class="line">                    <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        (void) path;</div><div class="line">        res = pread(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, buf, size, offset);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                res = -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> res;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_read_buf(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> <a class="code" href="structfuse__bufvec.html">fuse_bufvec</a> **bufp,</div><div class="line">                        <span class="keywordtype">size_t</span> size, off_t offset, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keyword">struct </span><a class="code" href="structfuse__bufvec.html">fuse_bufvec</a> *src;</div><div class="line"></div><div class="line">        (void) path;</div><div class="line"></div><div class="line">        src = malloc(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> <a class="code" href="structfuse__bufvec.html">fuse_bufvec</a>));</div><div class="line">        <span class="keywordflow">if</span> (src == NULL)</div><div class="line">                <span class="keywordflow">return</span> -ENOMEM;</div><div class="line"></div><div class="line">        *src = FUSE_BUFVEC_INIT(size);</div><div class="line"></div><div class="line">        src-&gt;<a class="code" href="structfuse__bufvec.html#a754caca61fdf8107d28b510505a033bb">buf</a>[0].<a class="code" href="structfuse__buf.html#a1928e204554f2d37cb8dac28a8a2f28c">flags</a> = <a class="code" href="fuse__common_8h.html#a5e36b839c4dbf0439bd85b61c7213a58affd5b3b7e9cdd5f89b3126eea96e033b">FUSE_BUF_IS_FD</a> | <a class="code" href="fuse__common_8h.html#a5e36b839c4dbf0439bd85b61c7213a58ad67d5c6075febad0594f06d46d02bfa9">FUSE_BUF_FD_SEEK</a>;</div><div class="line">        src-&gt;<a class="code" href="structfuse__bufvec.html#a754caca61fdf8107d28b510505a033bb">buf</a>[0].<a class="code" href="structfuse__buf.html#a62b2ae82904ac4355142984b9dd90d68">fd</a> = fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>;</div><div class="line">        src-&gt;<a class="code" href="structfuse__bufvec.html#a754caca61fdf8107d28b510505a033bb">buf</a>[0].<a class="code" href="structfuse__buf.html#a8de23b7869b06b9a9caef6beb7c9e88e">pos</a> = offset;</div><div class="line"></div><div class="line">        *bufp = src;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_write(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">const</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> size,</div><div class="line">                     off_t offset, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        (void) path;</div><div class="line">        res = pwrite(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, buf, size, offset);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                res = -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> res;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_write_buf(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> <a class="code" href="structfuse__bufvec.html">fuse_bufvec</a> *buf,</div><div class="line">                     off_t offset, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keyword">struct </span><a class="code" href="structfuse__bufvec.html">fuse_bufvec</a> dst = FUSE_BUFVEC_INIT(<a class="code" href="fuse__common_8h.html#a4327f41b2fe1ca84151b407169bd86c0">fuse_buf_size</a>(buf));</div><div class="line"></div><div class="line">        (void) path;</div><div class="line"></div><div class="line">        dst.<a class="code" href="structfuse__bufvec.html#a754caca61fdf8107d28b510505a033bb">buf</a>[0].<a class="code" href="structfuse__buf.html#a1928e204554f2d37cb8dac28a8a2f28c">flags</a> = <a class="code" href="fuse__common_8h.html#a5e36b839c4dbf0439bd85b61c7213a58affd5b3b7e9cdd5f89b3126eea96e033b">FUSE_BUF_IS_FD</a> | <a class="code" href="fuse__common_8h.html#a5e36b839c4dbf0439bd85b61c7213a58ad67d5c6075febad0594f06d46d02bfa9">FUSE_BUF_FD_SEEK</a>;</div><div class="line">        dst.<a class="code" href="structfuse__bufvec.html#a754caca61fdf8107d28b510505a033bb">buf</a>[0].<a class="code" href="structfuse__buf.html#a62b2ae82904ac4355142984b9dd90d68">fd</a> = fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>;</div><div class="line">        dst.<a class="code" href="structfuse__bufvec.html#a754caca61fdf8107d28b510505a033bb">buf</a>[0].<a class="code" href="structfuse__buf.html#a8de23b7869b06b9a9caef6beb7c9e88e">pos</a> = offset;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> <a class="code" href="fuse__common_8h.html#a9ca301390fb5e85b85153abb1891a3f7">fuse_buf_copy</a>(&amp;dst, buf, <a class="code" href="fuse__common_8h.html#aec0ad71a3e8c357ebe7e87cdecbdbe18a32ec833f1eb4b5cd9283cf9d93021037">FUSE_BUF_SPLICE_NONBLOCK</a>);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_statfs(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> statvfs *stbuf)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        res = statvfs(path, stbuf);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_flush(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line"></div><div class="line">        (void) path;</div><div class="line">        <span class="comment">/* This is called from every close on an open file, so call the</span></div><div class="line"><span class="comment">           close on the underlying filesystem.  But since flush may be</span></div><div class="line"><span class="comment">           called multiple times for an open file, this must not really</span></div><div class="line"><span class="comment">           close the file.  This is important if used on a network</span></div><div class="line"><span class="comment">           filesystem like NFS which flush the data/metadata on close() */</span></div><div class="line">        res = close(dup(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>));</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_release(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        (void) path;</div><div class="line">        close(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>);</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_fsync(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keywordtype">int</span> isdatasync,</div><div class="line">                     <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line">        (void) path;</div><div class="line"></div><div class="line"><span class="preprocessor">#ifndef HAVE_FDATASYNC</span></div><div class="line">        (void) isdatasync;</div><div class="line"><span class="preprocessor">#else</span></div><div class="line">        <span class="keywordflow">if</span> (isdatasync)</div><div class="line">                res = fdatasync(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line"><span class="preprocessor">#endif</span></div><div class="line">                res = fsync(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="preprocessor">#ifdef HAVE_POSIX_FALLOCATE</span></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_fallocate(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keywordtype">int</span> mode,</div><div class="line">                        off_t offset, off_t length, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi)</div><div class="line">{</div><div class="line">        (void) path;</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span> (mode)</div><div class="line">                <span class="keywordflow">return</span> -EOPNOTSUPP;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> -posix_fallocate(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, offset, length);</div><div class="line">}</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"><span class="preprocessor">#ifdef HAVE_SETXATTR</span></div><div class="line"><span class="comment">/* xattr operations are optional and can safely be left unimplemented */</span></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_setxattr(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value,</div><div class="line">                        <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span> flags)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res = lsetxattr(path, name, value, size, flags);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_getxattr(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">char</span> *value,</div><div class="line">                        <span class="keywordtype">size_t</span> size)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res = lgetxattr(path, name, value, size);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line">        <span class="keywordflow">return</span> res;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_listxattr(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keywordtype">char</span> *list, <span class="keywordtype">size_t</span> size)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res = llistxattr(path, list, size);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line">        <span class="keywordflow">return</span> res;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_removexattr(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">const</span> <span class="keywordtype">char</span> *name)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res = lremovexattr(path, name);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"><span class="preprocessor">#endif </span><span class="comment">/* HAVE_SETXATTR */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line"><span class="preprocessor">#ifdef HAVE_LIBULOCKMGR</span></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_lock(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi, <span class="keywordtype">int</span> cmd,</div><div class="line">                    <span class="keyword">struct</span> flock *lock)</div><div class="line">{</div><div class="line">        (void) path;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> ulockmgr_op(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, cmd, lock, &amp;fi-&gt;<a class="code" href="structfuse__file__info.html#a3575f36b21f406c211c41c8c31323688">lock_owner</a>,</div><div class="line">                           <span class="keyword">sizeof</span>(fi-&gt;<a class="code" href="structfuse__file__info.html#a3575f36b21f406c211c41c8c31323688">lock_owner</a>));</div><div class="line">}</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> xmp_flock(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi, <span class="keywordtype">int</span> op)</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> res;</div><div class="line">        (void) path;</div><div class="line"></div><div class="line">        res = flock(fi-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, op);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="preprocessor">#ifdef HAVE_COPY_FILE_RANGE</span></div><div class="line"><span class="keyword">static</span> ssize_t xmp_copy_file_range(<span class="keyword">const</span> <span class="keywordtype">char</span> *path_in,</div><div class="line">                                   <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi_in,</div><div class="line">                                   off_t off_in, <span class="keyword">const</span> <span class="keywordtype">char</span> *path_out,</div><div class="line">                                   <span class="keyword">struct</span> <a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi_out,</div><div class="line">                                   off_t off_out, <span class="keywordtype">size_t</span> len, <span class="keywordtype">int</span> flags)</div><div class="line">{</div><div class="line">        ssize_t res;</div><div class="line">        (void) path_in;</div><div class="line">        (void) path_out;</div><div class="line"></div><div class="line">        res = copy_file_range(fi_in-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, &amp;off_in, fi_out-&gt;<a class="code" href="structfuse__file__info.html#a45314d0b92a8d4c9de33d996aa59ada8">fh</a>, &amp;off_out, len,</div><div class="line">                              flags);</div><div class="line">        <span class="keywordflow">if</span> (res == -1)</div><div class="line">                <span class="keywordflow">return</span> -errno;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> res;</div><div class="line">}</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keyword">struct </span><a class="code" href="structfuse__operations.html">fuse_operations</a> xmp_oper = {</div><div class="line">        .<a class="code" href="structfuse__operations.html#a0ad1f7c4105ee062528c767da88060f0">init</a>           = xmp_init,</div><div class="line">        .getattr        = xmp_getattr,</div><div class="line">        .access         = xmp_access,</div><div class="line">        .readlink       = xmp_readlink,</div><div class="line">        .opendir        = xmp_opendir,</div><div class="line">        .readdir        = xmp_readdir,</div><div class="line">        .releasedir     = xmp_releasedir,</div><div class="line">        .mknod          = xmp_mknod,</div><div class="line">        .mkdir          = xmp_mkdir,</div><div class="line">        .symlink        = xmp_symlink,</div><div class="line">        .unlink         = xmp_unlink,</div><div class="line">        .rmdir          = xmp_rmdir,</div><div class="line">        .rename         = xmp_rename,</div><div class="line">        .link           = xmp_link,</div><div class="line">        .chmod          = xmp_chmod,</div><div class="line">        .chown          = xmp_chown,</div><div class="line">        .truncate       = xmp_truncate,</div><div class="line"><span class="preprocessor">#ifdef HAVE_UTIMENSAT</span></div><div class="line">        .utimens        = xmp_utimens,</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line">        .create         = xmp_create,</div><div class="line">        .open           = xmp_open,</div><div class="line">        .read           = xmp_read,</div><div class="line">        .read_buf       = xmp_read_buf,</div><div class="line">        .write          = xmp_write,</div><div class="line">        .write_buf      = xmp_write_buf,</div><div class="line">        .statfs         = xmp_statfs,</div><div class="line">        .flush          = xmp_flush,</div><div class="line">        .release        = xmp_release,</div><div class="line">        .fsync          = xmp_fsync,</div><div class="line"><span class="preprocessor">#ifdef HAVE_POSIX_FALLOCATE</span></div><div class="line">        .fallocate      = xmp_fallocate,</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"><span class="preprocessor">#ifdef HAVE_SETXATTR</span></div><div class="line">        .setxattr       = xmp_setxattr,</div><div class="line">        .getxattr       = xmp_getxattr,</div><div class="line">        .listxattr      = xmp_listxattr,</div><div class="line">        .removexattr    = xmp_removexattr,</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"><span class="preprocessor">#ifdef HAVE_LIBULOCKMGR</span></div><div class="line">        .lock           = xmp_lock,</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line">        .flock          = xmp_flock,</div><div class="line"><span class="preprocessor">#ifdef HAVE_COPY_FILE_RANGE</span></div><div class="line">        .copy_file_range = xmp_copy_file_range,</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line">};</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])</div><div class="line">{</div><div class="line">        umask(0);</div><div class="line">        <span class="keywordflow">return</span> <a class="code" href="fuse_8h.html#ac99b844cee7aaa8fb4e35df5b5488d82">fuse_main</a>(argc, argv, &amp;xmp_oper, NULL);</div><div class="line">}</div></div><!-- fragment --> 
<p class="definition">Definition in file <a class="el" href="null_8c_source.html">null.c</a>.</p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
